#include<bits/stdc++.h>
using namespace std;
long long n;
long long a[10005];
int ans;
long long b[10005],c[10005];
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	int m1=0,m0=0;
	int zhi=0;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(a[i]==1)
		  m1++;
		if(a[i]==2)
		  m0++;
		b[a[i]]+=1;
		if(a[i]>zhi) zhi=a[i];
	}	
	int tol1=0;
	for(int i=1;i<=zhi;i++){
		if(b[i]!=0){
			tol1=tol1+1;
			c[tol1]=b[i];
		}
	}
	if(m1+m0==n){
		if(m1>m0)
		  ans=m1;
		else
		  ans=m0;
		cout<<ans;
	}
	else{
		for(int i=1;i<tol1;i++){
			if(c[i]>c[i+1]){
				c[i+1]=c[i];
			}
			c[i]=0;
		}
		ans=c[tol1];
		cout<<ans;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
